home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-21 / qwhite.zip / EXCEPT13.TEC < prev    next >
Text File  |  1992-03-09  |  8KB  |  125 lines

  1. ID:13 Exception #12 and #13 and QEMM-386 
  2. Quarterdeck Technical Note #142
  3. by Bob Perry and Dan Sallitt
  4. last revision:  12 February 1992
  5.  
  6. Q: WHAT IS AN "Exception #12"?  WHAT IS AN "Exception #13"?       
  7.                      
  8. Q: WHAT CAN BE DONE TO PREVENT EXCEPTION #12s AND #13s?
  9.  
  10. EXCEPTIONS
  11.  
  12.      Exceptions are unusual or invalid conditions associated with the 
  13. execution of a particular instruction by the 80386 processor (or higher 
  14. processors).  The 80386 recognizes several different classes of exceptions, 
  15. and assigns a different vector number to each class. The DESQview-386 memory 
  16. manager, QEMM-386, has been designed to capture these 80386 exception vectors 
  17. and display them directly to the user.
  18.  
  19. EXCEPTION #13
  20.  
  21.     Exception #13 is the "General Protection Fault" error.  Any privileged 
  22. instruction or any instruction that references memory can trigger an Exception 
  23. #13.  It is the most commonly encountered 80386 fault.
  24.     The two circumstances that can cause an Exception #13 to occur require 
  25. very different troubleshooting approaches.  In the first case, privileged 
  26. instructions, the Exception #13 could indicate that a program has violated the 
  27. protected mode of the 80386 by executing a privileged instruction or I/O 
  28. reference.  Thus, when the prompt "Terminate, Reboot or Continue?" is issued, 
  29. the "Continue" option puts the system back into real mode, and the program 
  30. should continue to execute. (After choosing the "Continue" option, one should 
  31. not necessarily assume that the system is stable.  A reboot at the earliest 
  32. convenient time is probably wise.)  It is possible that none of these options 
  33. will work, and you must reboot your system.
  34.      It is the second case, instructions that reference memory, that is far 
  35. more common to DESQview 386 (and QEMM-386) users.  Here the exception may 
  36. indicate that an application has a bug, or that adverse circumstances have 
  37. sent it out of control.  It has overwritten its memory partition, and may in 
  38. fact be running wild, executing meaningless code.  This situation can occur 
  39. with some programs that were written for use on the 8088 processor and may not 
  40. be usable in the 80386's virtual 8086 mode. 
  41.      A few other programs may not be compatible with QEMM-386.  In some cases 
  42. the problem occurs even without QEMM-386 present (in which case it manifests 
  43. itself as a crash instead of an error message).  What this usually adds up to 
  44. is that when "Terminate, Reboot or Continue" is displayed, the user can 
  45. usually only "Terminate."
  46.      On a technical level, this overwriting of the memory partition generally 
  47. means that a word or a double word value has been fetched from or written to 
  48. the last byte of a segment.  The problem or "bug" in the application program 
  49. or in the system shows up as an attempt to wrap the value to the next segment 
  50. of memory.
  51.  
  52. WHAT CAN THE USER DO TO PREVENT EXCEPTION #13s?   
  53.  
  54.      IN DESQVIEW
  55.  
  56.      The DESQview 386 user should start with two simple steps:  first, run 
  57. Change a Program and raise the number in "Maximum program memory size" (on the 
  58. Advanced Options screen) 999.  Second, the user can try to increase the 
  59. protection level of the afflicted window to 3, which will not remove the 
  60. source of the Exception #13, but may pass more descriptive error messages 
  61. through to the user.  
  62.  
  63.      OUTSIDE OF DESQVIEW
  64.  
  65.      When Exception #13's are obtained outside of DESQview they are either 
  66. caused by applications written for the 80386 protected mode or they are not.  
  67. If the faulting application is written for the protected mode of the 80386, it 
  68. is likely that this program has no VCPI (Virtual Control Program Interface) 
  69. support.  Since QEMM-386 is a protected mode program, such faulting 
  70. applications cannot be run under QEMM without VCPI.  The user has no choice 
  71. but to reboot without QEMM, and contact the developer of the faulting 
  72. application to request VCPI support.
  73.      If the faulting application was not written for the protected mode of the 
  74. 80386, a good possibility is that the QEMM-386 user has installed QEMM-386 
  75. with the RAM parameter (which is necessary to LOADHI drivers and TSRs).  In 
  76. this case the faulting program may be running in an area of high RAM that 
  77. contains a memory conflict.  To correct this problem, the user may choose to 
  78. RAM only specific areas of memory, as described on page 6 of the QEMM-386 
  79. manual, rather than to RAM all mappable areas.  Of course, an area of conflict 
  80. that is not RAMmed is still an area of conflict, and may cause problems if 
  81. another application tries to map expanded memory into that region.  A better 
  82. solution to such memory conflicts might be to use the EXCLUDE parameter 
  83. (described on page 5 of the QEMM manual) on the area in conflict.  
  84.      To find a portion of the address space which should be excluded you 
  85. should consult the "Analysis" section of the "QEMM.COM" chapter of the QEMM-
  86. 386 manual.  For greater detail, see the Quarterdeck Technical Bulletin #219, 
  87. "Using QEMM-386's Analysis Feature".
  88.     Some pieces of hardware can come into conflict with QEMM-386 or DESQview 
  89. and generate Exception #13 errors.  The most frequent offenders are bus-
  90. mastering devices (hard disk controllers, network cards, CD-ROM controllers, 
  91. etc.) and autoswitching video cards.  Bus-mastering hard disk controllers 
  92. often cause Exception #13 errors upon any use of the LOADHI programs, for 
  93. instance.  For approaches to this problem, see the Quarterdeck Technical Note 
  94. #121, "Bus-Mastering Devices and QEMM-386."  Not all autoswitching video cards 
  95. come into conflict with QEMM-386 or other pieces of software.  When a conflict 
  96. occurs, however, it does not always take the form of a video problem, and 
  97. sometimes results in the Exception #13 message.  Disabling autoswitching is 
  98. the only solution to such a problem.
  99.     General troubleshooting methods, like temporarily removing all TSR's, 
  100. device drivers and questionable QEMM-386 parameters, often provide valuable 
  101. information about the exception error.  It sometimes happens that a 
  102. circumstance that generates an Exception #13 with QEMM-386 present simply 
  103. causes the machine to crash without any message when QEMM-386 is removed.  In 
  104. such a case, QEMM-386 is simply the bearer of bad news.
  105.  
  106. EXCEPTION #12
  107.  
  108.      Exception #12 is the "Stack Segment" fault.  The stack segment fault 
  109. occurs when the processor detects certain problems with the segment addressed 
  110. by the SS segment register.  This exception too can be the result either of a 
  111. bug in a program or of some system malfunction that eventually results in a 
  112. stack error.  All of the above methods of troubleshooting Exception #13 
  113. messages should also be used when trying to track down the cause of an 
  114. Exception #12.  The one difference that should be kept in mind is that 
  115. Exception #12 messages are not generated by an application simply going into 
  116. protected mode, executing privileged instructions, or accessing privileged 
  117. registers.  Therefore you need not consider the possibility that the 
  118. application needs to incorporate VCPI support to run with QEMM.
  119.  
  120.   ************************************************************************
  121.   *This technical note may be copied and distributed freely as long as it*
  122.   *is distributed in its entirety and it is not distributed for profit.  *
  123.   *         Copyright (C) 1990-2 by Quarterdeck Office Systems           *
  124.   ************************ E N D   O F   F I L E *************************
  125.